package com.example.administrator.himalaya.activity;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.example.administrator.himalaya.R;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView mBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        mBack = (ImageView) findViewById(R.id.back);
        mBack.setOnClickListener(this);
        Button button = (Button) findViewById(R.id.My_login);
        button.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.My_login:
                AlertDialog.Builder builder =
                        new AlertDialog.Builder(this);
                builder
                        .setCancelable(true)
                        .setMessage("用户名或密码为空")
                        .setTitle("温馨提示");
                builder.setNegativeButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int which) {
                        dialogInterface.dismiss();
                    }
                });
                builder.show();

                break;
        }
    }
}
